﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.Master" AutoEventWireup="true"
    CodeBehind="NewsManager.aspx.cs" Inherits="DesignLife.Admin.NewsManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="css/table.css"/>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div style="width: 1266px">
        <div style="float: left; width: 25%">
            <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                PageSize="2" ShowFooter="True" OnPageIndexChanging="gvNews_PageIndexChanging"
                OnSelectedIndexChanged="gvNews_SelectedIndexChanged">
                <Columns>
                    <asp:BoundField runat="server" DataField="NewsID" HeaderText="ID" />
                    <asp:BoundField runat="server" DataField="Title" HeaderText="Title" />
                    <asp:BoundField runat="server" DataField="Img1" HeaderText="Image" />
                    <asp:BoundField runat="server" DataField="Contents" HeaderText="Contents" />
                    <asp:BoundField runat="server" DataField="DateTime" HeaderText="Date Time" />
                    <asp:BoundField runat="server" DataField="CategoryName" HeaderText="Category Name" />
                    <asp:BoundField runat="server" DataField="Status" HeaderText="Status" />
                    <asp:ButtonField ButtonType="Button" Text="Edit" CommandName="select" />
                </Columns>
            </asp:GridView>
            <br />
            <table>
                <tr>
                    <td>
                        <asp:Label ID="Label1" runat="server" Text="Title: "></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtTitle" runat="server" ValidationGroup="News"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                            ErrorMessage="Title must Required" ValidationGroup="News"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label2" runat="server" Text="Contents: "></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtContent" TextMode="MultiLine" runat="server" ValidationGroup="News"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtContent"
                            ErrorMessage="Contents must Required" ValidationGroup="News"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label3" runat="server" Text="Image: "></asp:Label>
                    </td>
                    <td>
                        <asp:FileUpload ID="FileUpload1" runat="server" ValidationGroup="News" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label4" runat="server" Text="Category: "></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCategory" runat="server" ValidationGroup="News">
                        </asp:DropDownList>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label5" runat="server" Text="Status"></asp:Label>
                    </td>
                    <td>
                        <asp:CheckBox ID="ckbStatus" runat="server" ValidationGroup="News" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Image ID="Image1" Width="200px" Height="100px" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" Text="Submit" ValidationGroup="News" OnClick="btnSubmit_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div style="margin-left: 10px; float: left; width: 50%">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="gvCate" runat="server" AutoGenerateColumns="false" OnSelectedIndexChanged="gvCate_SelectedIndexChanged">
                        <Columns>
                            <asp:BoundField DataField="CategoryID" HeaderText="ID" runat="server" />
                            <asp:BoundField DataField="CategoryName" HeaderText="Category Name" runat="server" />
                            <asp:BoundField DataField="Link" HeaderText="Link" runat="server" />
                            <asp:BoundField DataField="Parrent" HeaderText="Parrent" runat="server" />
                            <asp:BoundField DataField="Summary" HeaderText="Summary" runat="server" />
                            <asp:BoundField DataField="Status" HeaderText="Status" runat="server" />
                            <asp:ButtonField ButtonType="Button" Text="Edit" CommandName="select" />
                        </Columns>
                    </asp:GridView>
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="Label6" runat="server" Text="Category Name"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtCTName" runat="server" ValidationGroup="Category"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Name must Required"
                                    ControlToValidate="txtCTName" ValidationGroup="Category"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label7" runat="server" Text="Link"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtLink" runat="server" ValidationGroup="Category"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Link must Required"
                                    ControlToValidate="txtLink" ValidationGroup="Category"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label8" runat="server" Text="Parrent"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList1" runat="server" ValidationGroup="Category">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label9" runat="server" Text="Summary"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSummary" TextMode="MultiLine" runat="server" ValidationGroup="Category"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Summary must Required"
                                    ControlToValidate="txtSummary" ValidationGroup="Category"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label10" runat="server" Text="Summary"></asp:Label>
                            </td>
                            <td>
                                <asp:CheckBox ID="ckbStatusCate" runat="server" ValidationGroup="Category" Enabled="False" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnSubmitCate" runat="server" Text="Submit" OnClick="btnSubmitCate_Click"
                                    ValidationGroup="Category" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
                <Triggers><asp:AsyncPostBackTrigger runat="server" ControlID="btnSubmitCate"/> </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
